<?php

$url = $this->context->id.'/'.$this->context->action->id;
?>
<?= \common\widgets\Asset::widget(['type'=>['summernote']])?>
<style>
    legend {
        width: auto !important;
        border-style: none !important;
    }
    .layui-tab-brief>.layui-tab-title .layui-this a {
        color: #009688 !important;
    }
</style>
<div class="ui-layout-center ui-layout-pane">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse" style="display: inline">
                <div class="layui-tab layui-tab-brief">
                    <ul class="layui-tab-title">
                        <?php foreach ($this->params['nav_all'] as $para):?>
                            <li class="<?=$url==$para['url']?'layui-this':''?>"><a href="<?=\yii\helpers\Url::to([$para['url']])?>"><?=$para['name']?></a></li>
                        <?php endforeach;?>
                    </ul>
                </div>
                <div class="layui-card-body">
                    <div class="layui-collapse like-layui-collapse" lay-accordion=""
                         style="border:1px dashed #c4c4c4">
                        <div class="layui-colla-item">
                            <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示<i
                                    class="layui-icon layui-colla-icon"></i></h2>
                            <div class="layui-colla-content layui-show">
                                <p>*具体请仔细看配置说明；</p>
                            </div>
                        </div>
                    </div>
                </div>
                <form class="form-horizontal" id="form-config-site-site">
                    <fieldset class="layui-elem-field layui-field-title site-title">
                        <legend><a name="use">会员折扣</a></legend>
                    </fieldset>
                    <div class="form-group">
                        <label class="col-sm-2 control-label is-required">活动折扣：</label>
                        <div class="col-sm-9">
                            <input type="text" name="activity_discount" value="<?=$model->activity_discount?>" style="width: 50%;display: inline" class="form-control" autocomplete="off"> 折
                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 购买活动打几折，0或不填将不打折，计算方式，商品金额*(折扣/10)=订单金额</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label is-required">商城折扣：</label>
                        <div class="col-sm-9">
                            <input type="text" name="shop_discount" value="<?=$model->shop_discount?>" style="width: 50%;display: inline" class="form-control" autocomplete="off"> 折
                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 购买活动打几折，0或不填将不打折，计算方式，商品金额*(折扣/10)=订单金额</span>
                        </div>
                    </div>
                    <fieldset class="layui-elem-field layui-field-title site-title">
                        <legend><a name="use">平台设置</a></legend>
                    </fieldset>
                    <div class="form-group">
                        <label class="col-sm-2 control-label is-required">小程序名称：</label>
                        <div class="col-sm-9">
                            <input type="text" name="apple_name" value="<?=$model->apple_name?>" style="width: 50%;display: inline" class="form-control" autocomplete="off">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label is-required">客服电话：</label>
                        <div class="col-sm-9">
                            <input type="text" name="phone" value="<?=$model->phone?>" style="width: 50%;display: inline" class="form-control" autocomplete="off">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label is-required">关于我们：</label>
                        <div class="col-sm-9">
                            <?= \common\widgets\FormInput::widget(['name' => 'textarea', 'extend' => ['height' => '500', 'name' => 'about_us', 'class' => 'summernote_content hide', 'info' => $model]]) ?>
                            <div class="summernote" data-place=""></div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label is-required">近期活动展示天数：</label>
                        <div class="col-sm-9">
                            <input type="text" name="recent_day" value="<?=$model->recent_day?>" style="width: 50%;display: inline" class="form-control" autocomplete="off"> 天
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label is-required">商城订单自动收货时间：</label>
                        <div class="col-sm-9">
                            <input type="text" name="receipt_time" value="<?=$model->receipt_time?>" style="width: 50%;display: inline" class="form-control" autocomplete="off"> 天
                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 订单发货后自动收货时间，0或不填将不进行自动收货</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label is-required">商城订单关闭时间：</label>
                        <div class="col-sm-9">
                            <input type="text" name="order_cancel" value="<?=$model->order_cancel?>" style="width: 50%;display: inline" class="form-control" autocomplete="off"> 分钟
                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 订单未支付自动关闭时间，0或不填将不进行自动关闭，不设置将影响数量</span>
                        </div>
                    </div>
<!--                    <div class="form-group">-->
<!--                        <label class="col-sm-2 control-label is-required">活动关闭时间：</label>-->
<!--                        <div class="col-sm-9">-->
<!--                            <input type="text" name="act_cancel" value="--><?//=$model->act_cancel?><!--" style="width: 50%;display: inline" class="form-control" autocomplete="off"> 分钟-->
<!--                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 活动未支付自动关闭时间，0或不填将不进行自动关闭，不设置将影响数量</span>-->
<!--                        </div>-->
<!--                    </div>-->
                    <?= \common\widgets\FormInput::widget(['name' => 'image|VIP入口图片', 'extend' => ['name' => 'imgarr2', 'id' => 'uploadimgbtn2', 'script_after' => '2', 'cat' => 'bmimage', 'water' => 'true', 'required' => 1, 'sm' => 2,'data'=>$model->vip_img]]) ?>
                    <input type="hidden" name="vip_img" id="img2">
                    <div class="form-group text-center mt20">
                        <a href="javascript:;" class="btn btn-success btn-mid b5submit_btn"
                           data-target="form-config-site-site" data-title="确定提交平台设置" data-url="<?=\yii\helpers\Url::to(['preserve'])?>">保存</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<?php $this->beginBlock('script'); ?>
    <script>
        function b5submit_btn_before() {
            var sHTML = $('.summernote').summernote('code');
            $(".summernote_content").val(sHTML);
            var target=$('.b5submit_btn').attr("data-target");
            var url=$('.b5submit_btn').attr("data-url");
            var title=$('.b5submit_btn').attr("data-title");
            imgassign("input[name='imgarr2[]']",'#img2')
            var data=$("#"+target).serialize();
            if(title){
                $.modal.confirm(title,function () {
                    $.operate.saveModal(url,data)
                });
            }else{
                $.operate.saveModal(url,data)
            }
        }
    </script>
<?php $this->endBlock(); ?>